<form nz-form class="ant-advanced-search-form">
  <div nz-row [nzGutter]="24">
    <div nz-col nzLg="12" nzXl="8">
      <nz-form-item nzFlex>
        <nz-form-label>{{l('lockset_no')}}</nz-form-label>
        <nz-form-control>
          <input type="text" [(ngModel)]="keyword" [ngModelOptions]="{standalone: true}" nz-input [placeholder]="l('please_enter_lockset_no')">
        </nz-form-control>
      </nz-form-item>
    </div>

    <div nz-col nzLg="12" nzXl="6" class="control-area">
      <button nz-button [nzType]="'primary'" (click)="load()">{{l('search')}}</button>
      <button nz-button (click)="reset()">{{l('reset')}}</button>
    </div>
  </div>

</form>

<nz-table nzBordered nzNoResult=" ">
  <thead>
    <tr>
      <th>{{statistics.siteName}}</th>
      <th>{{l('lockset_total_count')}}:{{statistics.totalCount}}</th>
      <th>{{l('stock_in_transit_count')}}:{{statistics.inTransit}}</th>
    </tr>
  </thead>
</nz-table>

<nz-table #ajaxTable nzShowSizeChanger nzBordered [nzScroll]="{x:'1300px'}" [nzFrontPagination]="false" [nzData]="tableHelper.items"
  [nzLoading]="tableHelper.loading" [nzTotal]="tableHelper.totalCount" [(nzPageIndex)]="tableHelper.pageIndex"
  [nzShowTotal]="totalTemplate" [(nzPageSize)]="tableHelper.pageSize" (nzPageIndexChange)="load()" (nzPageSizeChange)="load()">
  <thead>
    <tr>
      <th nzWidth="100px" nzLeft="0px">{{l('serial_number')}}</th>
      <th nzWidth="200px" nzLeft="100px">{{l("lockset_no")}}</th>
      <th>{{l('state')}}</th>
      <th nzWidth="140px" nzRight="0px">{{l('view_address')}}</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of ajaxTable.data;let i = index">
      <td nzLeft="0px">{{i++1}}</td>
      <td nzLeft="100px">{{data.lockNo}}</td>
      <td> {{data.stateName}}</td>
      <td nzRight="0px">
        <a (click)="showAddress(data.lockNo)" *ngIf="data.state==1&&data.hasUsed">{{l('view_real_address')}}</a>
        <a (click)="showAddress(data.lockNo)" *ngIf="data.state==2&&data.hasUsed">{{l('view_last_address')}}</a>
      </td>
    </tr>
  </tbody>
</nz-table>

<ng-template #totalTemplate let-total>
  {{l('total')}} {{total}} {{l('items')}}
</ng-template>

<app-lock-last-address-modal #lockAddressModal></app-lock-last-address-modal>